package June;
import java.util.Scanner;
public class Test_12_1 {
    public static void main(String[] args) {
        Scanner myScanner = new Scanner(System.in);
        BB a = new BB();
        if (a.isOdd(7)) {
            System.out.println("是奇数");
        } else {
            System.out.println("是偶数");
        }
        System.out.print("请输入行数: ");
        int row = myScanner.nextInt();
        System.out.print("请输入列数: ");
        int col = myScanner.nextInt();
        System.out.print("请输入字符: ");
        char c = myScanner.next().charAt(0);
        a.print(row, col, c);
    }
}

// 编写类AA 新方法:
// 判断一个数是奇数odd还是偶数,返回boolean
class BB {
    //思路
    //1.方法的返回类型 boolean
    //2.方法的名字 isOdd
    //3.方法的形参 (int num)
    //4.方法体 判断
    public boolean isOdd(int num) {
//        if (num % 2 != 0) {
//            return true;
//        } else {
//            return false;
//        }

        return num % 2 != 0;
    }

    // 根据行、列、字符打印 对应行数和列数的字符,
    // 比如:行:4，列:4，字符#,则打印相应的效果
    public void print(int row, int col, char c) {
        for (int i = 0; i < row; i++) {
            for (int j = 0; j < col; j++) {
                System.out.print(c);
            }
            System.out.println();
        }
    }
}

